package com.ibm.dtp.base.util.ejb.help;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

public class EJBLookupHelperImpl implements EJBLookupHelper {

	public <IF> IF lookup(Class<IF> clazz, String dataType) {
		try{
			Context context = new InitialContext();
			@SuppressWarnings("unchecked")
			IF ejb = (IF)context.lookup("java:comp/env/ejb/" + dataType);
			
			return ejb;
		} catch (NamingException e){
			e.printStackTrace();
		}
		return null;
	}
}
